import Vue from "vue";
const bus = new Vue();

export const EventBus = {
    on(name, fn) {
        bus.$on(name, fn);
    },
    emit(name, data) {
        bus.$emit(name, data);
    },
    off(name) {
        bus.$off(name);
    },
    offAll() {
        bus.$off();
    }
};
